import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

import Vant from 'vant';
import 'vant/lib/index.css';

Vue.use(Vant);

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/item',
    name: 'Item',
    component: () => import(/* webpackChunkName: "about" */ '../views/Item.vue')
  },
  {
    path: '/addressList',
    name: 'AddressList',
    component: () => import(/* webpackChunkName: "about" */ '../views/AddressList.vue')
  },
  {
    path: '/addressNew',
    name: 'AddressNew',
    component: () => import(/* webpackChunkName: "about" */ '../views/AddressNew.vue')
  },
  {
    path: '/addressEdit',
    name: 'AddressEdit',
    component: () => import(/* webpackChunkName: "about" */ '../views/AddressEdit.vue')
  },
  {
    path: '/orderDetail',
    name: '订单详情',
    component: () => import(/* webpackChunkName: "about" */ '../views/OrderDetail.vue')
  },
  {
    path: '/card',
    name: '购物车',
    component: () => import(/* webpackChunkName: "about" */ '../views/Card.vue')
  },
  {
    path: '/order',
    name: '订单',
    component: () => import(/* webpackChunkName: "about" */ '../views/Order.vue')
  },
  {
    path: '/login',
    name: '登录',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/search',
    name: '检索',
    component: () => import(/* webpackChunkName: "about" */ '../views/Search.vue')
  },
  {
    path: '/socket',
    name: '聊天',
    component: () => import(/* webpackChunkName: "about" */ '../views/WebSocket.vue')
  },
  {
    path: '/boke',
    name: '个人博客',
    component: () => import(/* webpackChunkName: "about" */ '../views/BoKe.vue')
  },
  {
    path: '/test',
    name: '测试',
    component: () => import(/* webpackChunkName: "about" */ '../views/Test.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
